#ifndef __CMSIS_MEM_H__
#define __CMSIS_MEM_H__

#include "cmsis_os.h"

/**
 * @description:
 * @param {size_t} xSize
 * @return {*}
 */
void *osMalloc(uint32_t xSize);

/**
 * @description:
 * @param {void *} pv
 * @return {*}
 */
void osFree( void * pv );

/**
 * @description:
 * @return {*}
 */
#define os_malloc(s)        ({              \
                                void *_ret; \
                                _ret = osMalloc(s);   \
                                memset(_ret, 0, s);   \
                                _ret;       \
                            })

/**
 * @description:
 * @return {*}
 */
#define os_free(p)          do  \
                            {   \
                                osFree(p);  \
                                p = NULL;   \
                            }while(0);

#endif /* __CMSIS_MEM_H__ */
